
        public Button FindChildButton(Visual elt, string btnName) {
            Button result = null;
            if (elt is Button) {
                Button btn = (Button)elt;
                if (btn.Name == btnName) {
                    return btn;
                }
            }

            for (int i = 0; i < VisualTreeHelper.GetChildrenCount(elt); i++) {
                result = FindChildButton((Visual)VisualTreeHelper.GetChild(elt, i), btnName);
                if (result != null)
                    break;
            }

            return result;
        }